﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CompanyBussiness;

namespace Website.admin.Control
{
    public partial class cCategoryDetail : System.Web.UI.UserControl
    {
        System.Web.UI.Control ct;
        HtmlGenericControl genControl;
        NewsManagement newsMana = new NewsManagement();
        string modulCode;

        protected void Page_Load(object sender, EventArgs e)
        {
            modulCode = Request.QueryString["Mod"];

            loadModul();


           

            PlaceHolderMetadata.Controls.Clear();
            genControl = new HtmlGenericControl("div");
            ct = Page.LoadControl("Control/cMetadata.ascx");
            genControl.Controls.Add(ct);
            PlaceHolderMetadata.Controls.Add(genControl);
        }

        protected void loadModul()
        {
            switch (modulCode)
            {
                case "MNEWS":
                    {
                        tabList.Visible = true;
                        //tab1.Visible = true;

                        PlaceHolderDetail.Controls.Clear();
                        genControl = new HtmlGenericControl("div");
                        ct = Page.LoadControl("Control/cCategoryCreate.ascx");
                        genControl.Controls.Add(ct);
                        PlaceHolderDetail.Controls.Add(genControl);

                        PlaceHolderNews.Controls.Clear();
                        genControl = new HtmlGenericControl("div");
                        ct = Page.LoadControl("Control/cListNews.ascx");
                        genControl.Controls.Add(ct);
                        PlaceHolderNews.Controls.Add(genControl);

                        lbTab1.Text = "Danh sách tin bài trong danh mục";
                        lbTab2.Text = "Mô tả cho danh mục";
                        lbTab3.Text = "Metadata";

                       
                    }
                    break;
                case "MSHAREHOLDERS":
                    {
                        tabList.Visible = true;
                        //tab1.Visible = true;

                        PlaceHolderDetail.Controls.Clear();
                        genControl = new HtmlGenericControl("div");
                        ct = Page.LoadControl("Control/cCategoryCreate.ascx");
                        genControl.Controls.Add(ct);
                        PlaceHolderDetail.Controls.Add(genControl);

                        PlaceHolderNews.Controls.Clear();
                        genControl = new HtmlGenericControl("div");
                        ct = Page.LoadControl("Control/cListNews.ascx");
                        genControl.Controls.Add(ct);
                        PlaceHolderNews.Controls.Add(genControl);

                        lbTab1.Text = "Danh sách tin bài trong danh mục";
                        lbTab2.Text = "Mô tả cho danh mục";
                        lbTab3.Text = "Metadata";
                    }
                    break;
                case "MJOB":
                    {
                        tabList.Visible = true;
                        //tab1.Visible = true;

                        PlaceHolderDetail.Controls.Clear();
                        genControl = new HtmlGenericControl("div");
                        ct = Page.LoadControl("Control/cCategoryCreate.ascx");
                        genControl.Controls.Add(ct);
                        PlaceHolderDetail.Controls.Add(genControl);

                        PlaceHolderNews.Controls.Clear();
                        genControl = new HtmlGenericControl("div");
                        ct = Page.LoadControl("Control/cListNews.ascx");
                        genControl.Controls.Add(ct);
                        PlaceHolderNews.Controls.Add(genControl);


                        lbTab1.Text = "Danh sách tin bài trong danh mục";
                        lbTab2.Text = "Mô tả cho danh mục";
                        lbTab3.Text = "Metadata";
                    }
                    break;
                case "MHELP":
                    {
                        tabList.Visible = true;
                        //tab1.Visible = true;

                        PlaceHolderDetail.Controls.Clear();
                        genControl = new HtmlGenericControl("div");
                        ct = Page.LoadControl("Control/cCategoryCreate.ascx");
                        genControl.Controls.Add(ct);
                        PlaceHolderDetail.Controls.Add(genControl);

                        PlaceHolderNews.Controls.Clear();
                        genControl = new HtmlGenericControl("div");
                        ct = Page.LoadControl("Control/cListNews.ascx");
                        genControl.Controls.Add(ct);
                        PlaceHolderNews.Controls.Add(genControl);

                        lbTab1.Text = "Danh sách tin bài trong danh mục";
                        lbTab2.Text = "Mô tả cho danh mục";
                        lbTab3.Text = "Metadata";
                    }
                    break;
                case "MCONTACT":
                    {
                        tabList.Visible = true;
                        //tab1.Visible = true;

                        PlaceHolderNews.Controls.Clear();
                        genControl = new HtmlGenericControl("div");
                        ct = Page.LoadControl("Control/cCategoryCreate.ascx");
                        genControl.Controls.Add(ct);
                        PlaceHolderNews.Controls.Add(genControl);

                        //PlaceHolderNews.Controls.Clear();
                        //genControl = new HtmlGenericControl("div");
                        //ct = Page.LoadControl("Control/cListNews.ascx");
                        //genControl.Controls.Add(ct);
                        //PlaceHolderNews.Controls.Add(genControl);

                        //lbTab1.Text = "Danh sách tin bài trong danh mục";
                        lbTab2.Text = "Mô tả";
                        lbTab3.Text = "Metadata";
                    }
                    break;
                case "MINTRO":
                    {
                        tabList.Visible = true;
                        //tab1.Visible = false;
                        //PlaceHolderNews.Visible = false;

                        PlaceHolderNews.Controls.Clear();
                        genControl = new HtmlGenericControl("div");
                        ct = Page.LoadControl("Control/cCategoryCreate.ascx");
                        genControl.Controls.Add(ct);
                        PlaceHolderNews.Controls.Add(genControl);

                        //PlaceHolderNews.Controls.Clear();
                        //genControl = new HtmlGenericControl("div");
                        //ct = Page.LoadControl("Control/cListNews.ascx");
                        //genControl.Controls.Add(ct);
                        //PlaceHolderNews.Controls.Add(genControl);

                        lbTab1.Text = "Nội dung";
                        //link2.Attributes.Add("class", "default-tab") ;

                        lbTab3.Text = "Metadata";
                    }
                    break;
            }


        }
    }
}